"""
async loop 2 sync loop: impossible!
"""
import asyncio


async def async_generator(char, n, interval=0.001):
    numbers = asyncio.gather(*range(n))
    for i in range(n):
        await asyncio.sleep(interval)  # Important to concurrency
        yield f'{char}'


def sync_generator(char, n, interval=0.001):
    pass
    # async for char in async_generator(char, n, interval):  # async for only available in async def
    #     yield f'{char}'
        

async def print_chars(char, n, interval=0.001):
    for char in sync_generator(char, n, interval):
        print(f'{char}', end='', flush=True)


if __name__ == '__main__':

    async def main():
        task1 = asyncio.create_task(print_chars('1', 200))
        task2 = asyncio.create_task(print_chars('2', 200))
        task3 = asyncio.create_task(print_chars('3', 200))
        await task1
        await task2
        await task3

    asyncio.run(main())
